/* ----------------------------- Noble Steed Engine----------------------------*
Authors : Daniel Randle, Alex Bourne
Date Created : April 09 2013

File:
	nsmapbuilder.h

Description:
	This file contains the NSMapBuilder which is the tool the engine uses
	for building maps.
*---------------------------------------------------------------------------*/

#ifndef NSMAPBUILDER_H
#define NSMAPBUILDER_H

#include <global.h>
#include <nsmath3d.h>

class NSMapArea;
class NSObject;
class NSObjectReference;

class NSMapBuilder
{
public:
	NSMapBuilder(NSMapArea * map);
	bool activate(const NSVec3Df & position=NSVec3Df(), const NSVec3Df & orientation=NSVec3Df(), const NSVec3Df & scale=NSVec3Df(1.0,1.0,1.0));  // creates the reference or multiple references if the current tile tool dicates
	bool addToMap();
	bool deactivate();

	bool isActivated();

	NSObject * getObject();
	NSVec3Df getPosition();
	NSObjectReference * getReference(unsigned int refID);

	void moveXYFromMouse(const NSVec2Df & currentMousePos, const NSVec2Df & lastMousePos);
	void moveZFromMouse(const NSVec2Df & currentMousePos, const NSVec2Df & lastMousePos);

	void rotate(const NSVec3Df & amount);
	void scale(const NSVec3Df & amount);
	bool setObject(NSObject * obj);
	void translate(const NSVec3Df & amount);

	void update();
private:
	NSObjectReference * refToAdd;
	NSMapArea * mapArea;
	NSObject * buildObj;

	bool activated;
};


#endif